// 基于jquery扩展实例方法
(function ($) {
    var Builder = function (ele, options) {
        var _this = this;
        this.$ele = ele;
        this.opts = $.extend(true, {}, _this.defaults, options);
        this.text = function () {
            this.$ele.append('init-' + _this.opts.txt);
            if (_this.opts.callback != undefined && typeof _this.opts.callback == 'function') {
                callback();
            }
        };
    };
    // 定义Builder方法
    Builder.prototype.init = function () {
        this.text();
    }
    // 默认参数
    Builder.prototype.defaults = {
        txt: "文本"
    }
    // 插件中使用Builder对象
    $.fn.test1 = function (options) {
        var builder = new Builder(this, options);
        return builder.init();;
    }
})(jQuery);